<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <title>control::TimeAvg</title>
  <meta http-equiv='Content-type' content='text/html;charset=UTF-8' />
  <link rel='stylesheet' type='text/css' href='../style.css'/>
</head>
<body>
<p>
  <a href='../index.html'>
    <img src='../logo.png' alt='Sedona'/>
  </a>
</p>
<div class='nav'>
  <a href='../index.html'>Index</a> |
  <a href='../api.html'>Kits</a> |
  <a href='index.html'>control</a>
</div>
<h1 class='title'>control::TimeAvg</h1>
<hr/>
<pre class='inheritance'><a href='../sys/Obj.html'>sys::Obj</a>
  <a href='../sys/Virtual.html'>sys::Virtual</a>
    <a href='../sys/Component.html'>sys::Component</a>
      control::TimeAvg
</pre>
<em>public </em> class <b>TimeAvg</b>  [niagaraIcon=&#x22;module://icons/x16/control/math/average.png&#x22;]<br>
<hr/>
<p>TimeAvg object averages &#x22;in&#x22; over the configured time.&#xa;The actual time is marked in a resolution of scan period (see App.scanPeriod)&#xa;such that number of samples averaged = time/Sys.app.scanPeriod</p>
<p>Note that this is NOT a running average - this object caches the average over&#xa;the previous time as the out value, and updates out every &#x22;time&#x22; ms.</p>
<p>Unil a full time cycle has elapsed, the out is set to the average off all samples&#xa;collected up until that point.</p>
<p>The average may be reset/restarted at any time using the &#x22;reset&#x22; action.</p>
<hr/>
<dl>
<dt>execute</dt>
<dd><p class='sig'><code><em><em>public</em> <em>virtual</em> <em>override</em> </em><b>void execute()</b>

</code></p>
<p>calculate the average.  If not enough samples collected, then average the ones we have.</p>
</dd>
<dt>in</dt>
<dd><p class='sig'><code><em><em>public</em> <em>property</em> </em><b>float in</b>

</code></p>
<p>The value to average</p>
</dd>
<dt>out</dt>
<dd><p class='sig'><code><em><em>public</em> <em>property</em> </em><b>float out</b> [readonly]

</code></p>
<p>Value averaged over last &#x22;time&#x22; period</p>
</dd>
<dt>reset</dt>
<dd><p class='sig'><code><em><em>public</em> <em>action</em> </em><b>void reset()</b>

</code></p>
<p>Reset the average computation</p>
</dd>
<dt>start</dt>
<dd><p class='sig'><code><em><em>public</em> <em>virtual</em> <em>override</em> </em><b>void start()</b>

</code></p>
<p>Override start to initialize averaging variables</p>
</dd>
<dt>time</dt>
<dd><p class='sig'><code><em><em>public</em> <em>property</em> </em><b>int time</b> [summary, config, unit=&#x22;millisecond&#x22;]

</code></p>
<p>The time period over which to average the in value to get the out value</p>
</dd>
</dl>
<div class='nav'>
  <a href='../index.html'>Index</a> |
  <a href='../api.html'>Kits</a> |
  <a href='index.html'>control</a>
</div>
<div class='copyright'>Copyright &#169; 2009, Tridium, Inc.</div>
</body>
</html>
